package org.helgoboss.mintty

import java.io.File
import org.helgoboss.scala_additions.Implicits._

class MinttyCommand (
            val exeFile: File, 
            val configFile: Option[File],
            val windowTitle: Option[String],
            val keepOpen: Boolean
        ) {
        
    val components = {
        List (
            List(exeFile.osDependentPathExpression),
            windowTitle match {
                case Some(t) => List("--title", t)
                case None => Nil
            },
            configFile match {
                case Some(f) => List("--config", f.cygwinCompatibleUnixPathExpression)
                case None => Nil
            },
            List("--hold"),
            List(if (keepOpen) "always" else "never")
        ).flatten
    }
}